all: libpfring pcap ring_examples mod_perl tcpdump

tcpdump:
	cd tcpdump-4.0.0-pfring; ./configure LDFLAGS='-L../libpcap-1.0.0-pfring'; make

libpfring:
	cd lib; ./configure; make

pcap:
	cd libpcap-1.0.0-pfring; ./configure --enable-ipv6; make

ring_examples:
	cd examples; make

mod_perl:
	cd perl; make

####################################################################################

clean: libpfring_clean pcap_clean ring_examples_clean mod_perl_clean tcpdump_clean
	-rm -rf lib/config.log \
		lib/config.status \
		lib/Makefile \
		libpcap-1.0.0-pfring/config.status \
		libpcap-1.0.0-pfring/config.log \
		libpcap-1.0.0-pfring/config.h \
		libpcap-1.0.0-pfring/Makefile \
		libpcap-1.0.0-pfring/net/net \
		perl/Net-Pfring/Makefile.old \
		tcpdump-4.0.0-pfring/config.status \
		tcpdump-4.0.0-pfring/config.log \
		tcpdump-4.0.0-pfring/config.h \
		tcpdump-4.0.0-pfring/Makefile

tcpdump_clean:
	cd tcpdump-4.0.0-pfring; make clean

libpfring_clean:
	cd lib; make clean

pcap_clean:
	if test -f libpcap-1.0.0-pfring/config.status; then cd libpcap-1.0.0-pfring; make clean; fi

ring_examples_clean:
	cd examples; make clean

mod_perl_clean:
	if test -f perl/Net-Pfring/Makefile; then cd perl; make clean; fi
